One typical requirement in a temperature sensor application is to generate a digital pulse width modulation (PWM) output wherein the duty cycle varies based on the temperature sensed. Various solutions are available either by using a microcontroller, an ASIC, or simply using an analog comparator which compares sensor output with a saw tooth wave. Using an analog comparator is the easiest solution, though it may not ensure high accuracy. Using a microcontroller enables better accuracy, though it requires writing and maintaining software code for the microcontroller.